package com.dhms.vostok1.adapter

import androidx.databinding.BindingAdapter
import androidx.recyclerview.widget.RecyclerView
import com.dhms.vostok1.base.LayoutManagers
import kotlinx.coroutines.*


object RecyclerViewBindingAdapter {

    @JvmStatic
    @BindingAdapter("layoutManager")
    fun setLayoutManager(recyclerView: RecyclerView, layoutManagerFactory: LayoutManagers.LayoutManagerFactory) {
        recyclerView.layoutManager = layoutManagerFactory.create(recyclerView)
    }


    @JvmStatic
    @BindingAdapter("itemAnimator")
    fun setItemAnimator(recyclerView: RecyclerView, animator: RecyclerView.ItemAnimator) {
        recyclerView.itemAnimator = animator
    }

}